package main

import (
	"bytes"
	"fmt"
	"sync"
)

var _bufferPool = sync.Pool{
	New: func() interface{} {
		return new(bytes.Buffer)
	},
}

func main() {
	buffer := _bufferPool.Get().(*bytes.Buffer)
	buffer.Reset()

	buffer.WriteString("test")
	fmt.Println(buffer.String())

	_bufferPool.Put(buffer)

}
